package iap.gui;
import javax.swing.*;

import java.awt.*;
import java.awt.event.*;


public class newframe extends JFrame {

	private JTextField input = new JTextField(15);
	private JTextArea output = new JTextArea(5, 15);

	public static void main(String[] args) {
		newframe frameTabel = new newframe();
	}

	JLabel title = new JLabel("Manage Deposit");
	JPanel panel = new JPanel();
	JButton button1 = new JButton("Action 1");
	JButton button2 = new JButton("Action 2");
	JButton button3 = new JButton("Action 3");
	JButton button4 = new JButton("Action 4");
	JButton button5 = new JButton("Action 5");
	JTextField text1 = new JTextField();

	newframe(){
		super("Deposit");
		setSize(600,450);
		setLocation(500,280);
		panel.setLayout (null);

		title.setBounds(20,-20,150,60);
		button1.setBounds(450,20,100,20);
		button2.setBounds(450,45,100,20);
		button3.setBounds(450,70,100,20);
		button4.setBounds(450,95,100,20);
		button5.setBounds(450,120,100,20);
		text1.setBounds(20, 20, 400, 400);

		panel.add(title);
		panel.add(button1);
		panel.add(button2);
		panel.add(button3);
		panel.add(button4);
		panel.add(button5);
		panel.add(text1);


		getContentPane().add(panel);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setVisible(true);
		actionButton1();
		actionButton2();
		actionButton3();
		actionButton4();
		actionButton5();
	}

	public void actionButton1(){
		button1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {

				JOptionPane.showMessageDialog(null,"Action 1");

			}
		});
	}
	public void actionButton2(){
		button2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {

				JOptionPane.showMessageDialog(null,"Action 2");

			}
		});
	}
	public void actionButton3(){
		button3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {

				JOptionPane.showMessageDialog(null,"Action 3");

			}
		});
	}
	public void actionButton4(){
		button4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {

				JOptionPane.showMessageDialog(null,"Action 4");

			}
		});
	}
	public void actionButton5(){
		button5.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {

				JOptionPane.showMessageDialog(null,"Action 5");

			}
		});
	}

	public void TextFieldEx()
	{  // Register a listener with the textfield
		TextFieldListener tfListener = new TextFieldListener();
		input.addActionListener(tfListener);

		// Don't let the user change the output.
		output.setEditable(false);

		// Add all the widgets to the applet
		this.getContentPane().add(input);
		this.getContentPane().add(output);
		input.requestFocus();        // start with focus on this field
	}

	// The listener for the textfield.
	private class TextFieldListener implements ActionListener
	{  public void actionPerformed(ActionEvent evt)
	{  String inputString = input.getText();
	output.append(inputString + "\n");
	input.setText("");
	}
	}

}